<?php
namespace Admin\Controller;
class UrlController extends CommonController {
	public function index()
	{
		$this->_page("Url",$num='10',$order="sort",$wheres='');
		$this->display();
	}
	//编辑
	public function edit()
	{
	 $name="Url";
		if (!empty($_POST)) {
			$this->_update($name);
		}else{
		  $this->_edit($name);
	  }
    }
    //修改状态
    public function status()
    {
    	$data['id']=I('post.sid');
    	$data['status']=I('post.sta');
    	$this->_status($data,"Url");
    }
    //修改排序
      public function sort()
    {
    	$data['fid']=I("post.type");
		$data['sort']=I("post.val");
    	$this->_status($data,"Url");
    }
    public function delete()
    {
    	$name="Url";
    	$sid=I("post.sid");
    	$this->_foreverdelete($name,$sid);
    }
    public function insert()
    {
    	
    	if (!empty($_POST)) {
    		$name="Url";
    		$this->_insert($name);
    	}else{
    		$this->display();
    	}
    }
}